import java.util.Scanner;
import java.util.Stack;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class snippet2 {
    public static void main(String[] args) {
//        Scanner in = new Scanner(System.in);
//        //输入字符串
//        String str = in.nextLine();
        String str = "ababc";
        remove(str);
    }

    private static void remove (String str) {
        while(str.length() > 0){
            if(str.length() < 1){
                System.out.println("0");
                break;
            }else if(str.length() == 1){
                System.out.println(str);
                break;
            }else{
                while(str.length() > 0){
                    int length = str.length();
                    char start = str.charAt(0);
                    if(str.charAt(str.indexOf(start) + 1) == start){
                        str.replace(str.charAt(start),' ');
                        str.replace(str.charAt(start),' ');
                    }
                }
                char[] nums = str.toCharArray();
                for (int i = 0; i < nums.length; i++) {
                    System.out.println(nums[i]);
                }
            }
        }

    }

    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        //获取输入
        String s=scanner.next();
        //辅助栈
        Stack<Character> stack=new Stack<Character>();
        //遍历字符串，当前字符与栈顶不相等就入栈，相等则栈顶元素出栈
        for(int i=0;i<s.length();++i) {
            char a=s.charAt(i);
            if(stack.isEmpty()||a!=stack.peek()) {
                stack.push(a);
            }else if(a==stack.peek()) {
                stack.pop();
            }
        }
        //输出处理
        //栈空说明最终是空串，输出0
        if(stack.isEmpty()) {
            System.out.println("0");
        }else {//如果不是空串就再引入一个栈来逆置字符输出
            Stack<Character>stk2=new Stack<Character>();
            while(!stack.isEmpty()) {
                stk2.push(stack.pop());
            }
            while(!stk2.isEmpty()) {
                System.out.print(stk2.pop());
            }
        }
        scanner.close();

    }
}